home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
dtk_demo.zip
/
ALL_DRVS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-12
|
2KB
|
80 lines
/* ALL_DRVS.C
* last mod.: 24-JUN-91
*/
/* this does not require a disk to be in the floppy drive(s) */
#include <STDIO.H>
#include <L_DISK.H>
void main(void);
void report_drive_parameters(int drive_num);
/*-----------*/
void main(void)
{
int i;
int num_floppy = num_floppy_drives();
int num_hard = num_hard_drives();
printf("\nNumber of floppy drives = %d",num_floppy);
for ( i=0; i<num_floppy; i++ )
{
printf("\nFloppy drive #%d: ",i);
report_drive_parameters(i);
}
printf("\nNumber of hard drives = %d",num_hard);
for ( i=0; i<num_hard; i++ )
{
printf("\nHard drive #%d: ",i);
report_drive_parameters(i+128);
}
}
/*---------------------------------------*/
void report_drive_parameters(int drive_num)
{
Uint num_sectors, num_cylinders, num_heads;
int type = drive_type(drive_num,&num_sectors,&num_cylinders,&num_heads);
switch ( type )
{
case -1:
printf("Invalid drive number.\n");
break;
case -2:
printf("Function not supported by BIOS.\n");
break;
case -3:
printf("BIOS reports an error.\n");
break;
default:
{
switch ( type )
{
case _D_FIXEDDISK:
printf("Fixed");
break;
case _D_360KB:
printf("360KB 5.25\" floppy");
break;
case _D_12MB:
printf("1.2MB 5.25\" floppy");
break;
case _D_720KB:
printf("720KB 3.5\" floppy");
break;
case _D_144MB:
printf("1.44MB 3.5\" floppy");
break;
default:
printf("Unidentified ");
}
printf(" disk drive with\n"
"%d sectors per track, %d tracks and %d heads.\n",
num_sectors,num_cylinders,num_heads);
}
}
}